<%@ include file="/page/share/taglib.jsp" %>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
    String realPath = request.getSession().getServletContext().getRealPath("/");
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <base href="<%=basePath%>">

    <title>我的考试列表</title>
    <link type="text/css" href="css/base.css" rel="stylesheet"/>
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <script type="text/javascript" src="../js/menu.js"></script>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <script type="text/javascript" src="<%=basePath%>/js/jquery.min.js"></script>
    <link href='<%=basePath%>/css/bootstrap-2.3.2.css' rel='stylesheet'>
    <script type="text/javascript" src="<%=basePath%>/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="<%=basePath%>/js/jquery.pnotify.js"></script>
    <link href="<%=basePath%>/css/jquery.pnotify.default.css" rel="stylesheet">

    <style type="text/css">
        .theTd {
            height: 30px;
            text-align: center;
            border-bottom: 1px solid #DDDDDD;
            line-height: 1.42857;
        }
    </style>
    <script type="text/javascript">


        function jumpForm(tag) {
            $("#beginExam" + tag).submit();
        }
    </script>


</head>

<body>
<%@ include file="/page/share/menu.jsp" %>

<div id="content" style="width:1180px;">
    <h2>我的考试列表</h2>
    <hr>

    <s:iterator value="examinations" var="examination">
        <div class="panel-body well well-lg" style="padding: 20px; border: 2px solid rgb(249, 249, 249);
        width: 700px;margin: 10px auto;font-family: 'Microsoft Yahei',Arial,Helvetica,sans-serif;"
             onmouseover='$(this).css("border","2px solid #0066CC");'
             onmouseout='$(this).css("border","2px solid #F9F9F9");'>
            <span class="label label-primary" style="font-size: 85%;float: right;margin-left: 20px;padding: 5px;">
                <c:if test="${examination.type=='PRACTICE'}">
                    练习
                </c:if>
            <c:if test="${examination.type=='EXAMINATION'}">
                考试
            </c:if>
            <c:if test="${examination.type=='TEST'}">
                测验
            </c:if></span>

            <div><strong>${examination.name}</strong>
                <span class="label label-default" style="font-size: 85%;margin-left: 20px;padding: 5px;">
                        ${examination.subject.subjectName}</span></div>
            <br/>
            <span class="label label-warning" style="font-size: 85%;float: right;margin-left: 20px;padding: 5px;">${examination.team.teamName}</span>

            <p><span style="float: left;">考试开始时间:</span><span>${examination.examBeginTime}</span></p>


            <p><span style="float: left;">考试结束时间:</span><span>${examination.examEndTime}</span></p>
            <span class="label label-danger" style="font-size: 85%;float: right;margin-left: 20px;padding: 5px;">
                <c:if test="${examination.examinationState=='PREPARE'}">
                    尚未开始
                </c:if>
                        <c:if test="${examination.examinationState=='PROCESS'}">
                            考试进行中
                        </c:if>
                        <c:if test="${examination.examinationState=='END'}">
                            考试结束
                        </c:if>
                        <c:if test="${examination.examinationState=='CHECKING'}">
                            改卷中
                        </c:if>
                        <c:if test="${examination.examinationState=='CANCEL'}">
                            考试作废
                        </c:if>
                        <c:if test="${examination.examinationState=='COMPLETE'}">
                            考试完成
                        </c:if></span>

            <p><span style="float: left;">考试时长:</span><span>${examination.time}</span></p>
            <form action="Examination!beginExamination.action" method="post" id="beginExam${examination.id}">
                <input type="hidden" name="account" value="${person.accout}"/>
                <input type="hidden" name="id" value="${examination.id}"/>
                <c:if test="${examination.examinationState=='PROCESS'}">

                <span style="float: right;">
                    <a href="javascript:void(0);" onclick="jumpForm(${examination.id})">开始考试</a>
            </span>
            </form>
            </c:if>
            <p><span style="float: left;">考试形式:</span><span>
                <c:if test="${examination.mode=='ROLL'}">
                    考试时长固定
                </c:if>
                <c:if test="${examination.mode=='STANDRARD'}">
                    考试开始和结束时间固定
                </c:if>
            </span></p>

        </div>
    </s:iterator>

</div>

<div id="footer">
    <p style="text-align: center;color: #757575;padding: 20px 0px 0px 0px; font:12px;">Copyright © 2010-2013 蓝天白云团队
        版权所有</p>
</div>
</body>
</html>
